home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / pas_0493.zip / ORDINAL.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-22  |  2KB  |  46 lines

  1. {─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
  2. Msg  : 260 of 267                                                               
  3. From : Rob Perelman                        1:202/1308.0         14 Apr 93  23:23 
  4. To   : Chris Bratene                                                             
  5. Subj : Pascal Probs                                                           
  6. ────────────────────────────────────────────────────────────────────────────────
  7. CB>  -  What's the CHARACTER that is returned when you hit your arrow keys?  I'
  8.   >     using a CHAR variable for input and would like to know what the arrow
  9.   >     keys give out as a CHAR.
  10.  
  11. CB>     ie. When you hit Return/Enter key it gives out #13
  12.  
  13. CB>   Could you lay out the commands for all 4 arrow keys like so:
  14.  
  15.  
  16. CB>                                /-\  up arrow = ??
  17.   >                                 |
  18.   >              left arrow = ?? <-- -->  right arrow = ??
  19.   >                                 |
  20.   >                                \_/
  21.   >                                     down arrow = ??
  22.  
  23. Try using this program to figure out how to use it:}
  24.  
  25. Program Ordinal;
  26.  
  27. Uses Crt;
  28.  
  29. Var Letter: Char;
  30. I: Integer;
  31.  
  32. Begin
  33.   TextBackGround(Black);
  34.   TextColor(LightGray);
  35.   Clrscr;
  36.   Repeat
  37.     Letter:=ReadKey;
  38.     If Letter=#0 then Begin
  39.       Letter:=ReadKey;
  40.       Writeln('Special characters: 0, ',Ord(Letter),' (',Letter,')');
  41.     End Else Writeln(Letter,' = ',Ord(Letter));
  42.   Until Letter=#27; {Escape}
  43. End.
  44.  
  45. This will show you how to use arrow keys, F-keys, and Alt-key (and a few
  46. other keys)!